<?php
/*
Template Name: Acasa
*/
?>

<?php get_header(); ?>
	
		<div id="container">	
			<div id="content">
			
				<div id="alerts" class="hide">
					<div class="alert box-shadow-small">
						<div class="alert-content">
							eSfaturi.ro este un site unde te informezi inainte sa mergi in magazin pentru a cumpara un produs electrocasnic, electronic sau IT. eSfaturi nu vinde produse, eSfaturi iti arata care sunt caracteristicile care conteaza cu adevarat la un produs.
							<a href="<?php echo esc_url( get_permalink( get_page_by_title( 'Despre noi' ) ) ); ?>">Vezi detalii</a>
						</div>
						<button id="alert-close" type="button">Close</button>
					</div>
				</div>
			
				<div id="slide-show" class="box-shadow-big">
					<?php 	
					global $post;
					$args = array( 'numberposts' => 5, 'post__in'  => get_option( 'sticky_posts' ) );
					$stickyPosts = get_posts( $args );
					$stickyPostIndex = 1; $hideClass = "";
					foreach( $stickyPosts as $post ) : setup_postdata($post); ?>
						<?php if($stickyPostIndex > 1) $hideClass = " hide"; ?>
						<div class="slide-show-post<?php echo $hideClass; ?>" id="post-<?php echo $stickyPostIndex; ?>">
							<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" >
								<?php the_post_thumbnail('thumb320x234', array('class' => '')); ?>
							</a>
							<div class="slide-show-post-content">
								<div><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></div>
								<div class="slide-show-post-subtitle">
									<span>Afla ce trebuie sa stii cand cumperi <?php echo indefinite_article(get_the_id()); ?> <?php echo strtolower(get_the_title()); ?>!</span>
								</div>
								<p><?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt, 50); ?> ...
								<a class="slide-show-advice" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">Vezi sfaturi</a></p>
							</div>
						</div>
						<?php $stickyPostIndex++; ?>
					<?php endforeach; ?>					
				</div><!-- #slide-show -->
				<div id="slide-show-thumbs">
					<div id="thumbs-wrapper">
						<div id="thumb-1" class="slide-show-thumb thumb-hover"></div>
						<div id="thumb-2" class="slide-show-thumb"></div>
						<div id="thumb-3" class="slide-show-thumb"></div>
						<div id="thumb-4" class="slide-show-thumb"></div>
						<div id="thumb-5" class="slide-show-thumb"></div>
					</div>
				</div><!-- #slide-show-thumbs -->
			
				<div id="recent-products-content">
					<h2 class="recent-products-title">Produse</h2>
					<div id="recent-products">
						<?php
						global $post;
						$numberPosts = get_option('esf_home_no_of_articles');
						$args = array( 'numberposts' => $numberPosts, 'post__not_in' => get_option( 'sticky_posts' ) );
						$lastPosts = get_posts( $args );
						foreach( $lastPosts as $post ) : setup_postdata($post); ?>
						<div class="recent-product">
							<!--div style="text-align:center;">
								<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" >
									<?php the_post_thumbnail('thumb150x150', array('class' => '')); ?>
								</a>
							</div-->
							<a class="recent-product-title" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
							<p class="recent-product-excerpt">
								<?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt, 19); ?> ...
								<a class="recent-product-advice" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">Vezi sfaturi</a>
							</p>
						</div>
						<?php endforeach; ?>
					</div>			
				</div><!-- #recent-products-content -->
				
			</div><!-- #content -->		
		</div><!-- #container -->
		
<?php get_sidebar(); ?>	
<?php get_footer(); ?>